 <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<html>
<head lang="en">
    <meta charset="UTF-8">
    <%@include file="style.jsp" %>
    <%@include file="script.jsp" %>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/orderlang/distributor/css/product_detail.css"/>
    <title>我的订货郎</title>
</head>
<body>
<div id="container_1" style="height:100%">
    <div style="position: relative">
        <%@include file="header.jsp" %>
    </div>
    <div id="content" class="clearfix">
        <%@include file="left_menu.jsp" %>
        <!--内容部分-->
        <div class="right-content" style="margin:75px 50px 0 213px;">
            <p class="brand">
                <a>商品</a>><a href="${pageContext.request.contextPath}/product/findProductList">商品查询</a>><a class="now">商品详情</a>
            </p>
            <div class="content-container" >
                <div class="detail clearfix">
                    <div class="pic fl">
                        <div class="big-img">
                            <c:forEach items="${photoList}" var="po">
                            	<c:if test="${po.isMain eq 1}">
                            		<img src="${pageContext.request.contextPath}/img/banner2+.jpg" alt=""/>
                            	</c:if>
                            </c:forEach>
                        </div>
                        <div class="small-img">
                            <span class="left-arrow fl scrollbutton disabled"></span>
                            <span class="right-arrow fr scrollbutton"></span>
                            <div class="img-list fl">
                                <ul>
                                    <c:forEach items="${photoList}" var="photo">
	                                    <li><img src="${pageContext.request.contextPath}/img/3.jpg"/></li>
	                                    <li><img src="${pageContext.request.contextPath}/img/4.jpg"/></li>
	                                    <li><img src="${pageContext.request.contextPath}/img/5.jpg"/></li>
                                        <%-- <li><img src="${photo.photoHref}"/></li> --%>
                                    </c:forEach>
                                </ul>
                            </div>
                        </div>
                    </div>
                    <div class="parameter fl">
                        <h3 class="product-name">${product.productName}<b>${product.label}</b></h3>
                        <ul class="product-parmeter clearfix">
                            <li>商品分类：<span>${product.categoryName}</span></li>
                            <li>商品品牌：<span>${product.brandName}</span></li>
                            <li>商品编号：<span>${product.code}</span></li>
                            <li>所属仓库：<span>${product.wareName}</span></li>
                            <li>上架状态：<span>${product.isOnShelve}</span></li>
                            <li>条形码：<span>${product.barCode}</span></li>
                            <li>单位：<span>${product.littleUnit}（1${product.bigUnit}=${product.unitConvert }${product.littleUnit}）</span></li>
                            <li>起订量：<span>${product.MOQ}</span></li>
                            <li>实际库存：<span>${product.actualInvertory}</span></li>
                            <c:forEach items="${warehouseProducs}" var="war">
                                	<li>${war.name}：<span>${war.actualInvertory}</span></li>
                            </c:forEach>
                           
                        </ul>
                        <div class="price">
                            <p>订货价：${product.orderedPrice}/${product.bigUnit}</p>
                            <p>进货价：<span>${product.purchasePrice}/${product.bigUnit}</span></p>
                            <p>市场价：${product.price}/${product.bigUnit}</p>
                        </div>
                        <%-- <div class="xinghao">
                            <c:forEach var="spec" items="${specMap}">
                            	<h4 class="fl">${spec.key}</h4>
                            	  <c:forEach items="${spec.value }" var="val">
                            	       <p>${val}</p>
                            	  </c:forEach><br>
                            </c:forEach>
                        </div> --%>
                        <div class="xinghao">
                            <c:forEach var="spec" items="${productSpecList}" varStatus="status">
                            	<div id = "${status.index}">
                            	<h4 class="fl">${spec.name}</h4>
                            	  <c:forEach items="${spec.value }" var="val">
                            	  	<c:if test="${val==defaultSpec[status.index]}">
                            	  		<p class="chose">${val}</p>
                            	  	</c:if>
                            	  	<c:if test="${val!=defaultSpec[status.index]}">
                            	  		<p>${val}</p>
                            	  	</c:if>
                            	  </c:forEach>
                            	  </div>
                            </c:forEach>
					    </div>
                        <table class="table1">
                            <thead>
                            <tr>
                                <td colspan="3">按照经销商级别定价</td>
                            </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td>客户级别</td>
                                    <td>订货价(元)</td>
                                    <td>起定量(根)</td>
                                </tr>
                                <c:forEach items="${disList}" var="dis">
                                	<tr>
	                                    <td>${dis.type}</td>
	                                    <td>${dis.orderedPrice}</td>
	                                    <td>${dis.MOQ}</td>
	                                </tr>
                                </c:forEach>
                            </tbody>
                        </table>
                        <table class="table2">
                            <thead>
                            <tr>
                                <td colspan="2">按照客户单独定价</td>
                            </tr>
                            </thead>
                            <tbody>
                            <tr>
                                <td>客户名称</td>
                                <td>订货价</td>
                            </tr>
                             <c:forEach items="${cusList}" var="cus">
                               	<tr>
                                    <td>${cus.name}</td>
                                    <td>${cus.orderedPrice}</td>
                                </tr>
                               </c:forEach>
                            </tbody>
                        </table>
                    </div>
                </div>
                <div class="fujian">
                    <div class="tab">
                         <ul class="clearfix">
                            <li>
                                                                               商品介绍
                                <div class="content">${product.detail}</div>
                            </li>
                            <li class="active">
                                                                               附件查看
                                <div class="content">
                                   <c:forEach items="${attList}" var="att">
                                       <a download="${att.attachmentName}" href="${att.attachmentHref}" >${att.attachmentName}</a><br>
                                   </c:forEach>
                                </div>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
        <!--内容部分结束-->
    </div>
</div>

        <script src="${pageContext.request.contextPath}/static/orderlang/distributor/js/product_detail.js"></script>
</body>
</html>